<script setup lang="ts">
import { ref } from "vue";
import Child from "./父传子的子组件.vue";
const name = ref("张三");
const age = ref(20);
const changeInfo = () => {
  name.value = "李四";
  age.value++;
};
const receiveFunc = (count: number) => {
  age.value = count;
};
</script>

<template>
  <div>
    <p>父组件的姓名：{{ name }}</p>
    <p>父组件的年龄：{{ age }}</p>
    <button @click="changeInfo">修改内容</button>
    <Child :name="name" :age="age" :func = "receiveFunc" @update-age = "receiveFunc"></Child>
  </div>
</template>

<style scoped></style>
